/*************************************************************************
	> File Name: 1.radixSort.cpp
	> Author: 
	> Mail: 
	> Created Time: 
 ************************************************************************/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

void coutSort(vector<int> &arr, int exp) {
    vector<int> output(arr.size());
    vector<int> count(10, 0);//计数数组
    //统计每个数字出现的次数
    for (int i = 0; i < arr.size(); i++) {
        int index = arr[i] / exp % 10;
        count[index]++;
    }
    for (int i = 1; i < 10; i++) {
        count[i] += count[i - 1];
    }
    for (int i = arr.size() - 1; i >= 0; i--) {
        int index = arr[i] / exp % 10;
        output[count[index] - 1] = arr[i];
        count[index]--;
    }
    for (int i = 0; i < arr.size(); i++) {
        arr[i] = output[i];
    }
    return ;
}

int getMaxDigit(int num) {
    int digit = 0;
    do {
        num /= 10;
        digit++;
    } while (num != 0);
    return digit;
}

void radixSort(vector<int> &arr) {
    int max_num = *max_element(arr.begin(), arr.end());
    int max_digit = getMaxDigit(max_num);
    int exp = 1;
    for (int i = 0; i < max_digit; i++) {
        coutSort(arr, exp);
        exp *= 10;
    }
    return ;
}

void output(vector<int> &arr) {
    for (int i = 0; i < arr.size(); i++) {
        if (i) cout << " ";
        cout << arr[i];
    }
    cout << endl;
    return ;
}

int main() {
    vector<int> arr;
    int n;
    cin >> n;
    for (int i = 0, x; i < n; i++) {
        cin >> x;
        arr.push_back(x);
    }
    radixSort(arr);
    output(arr);
    return 0;
}
